/**
 * 处理用户相关的逻辑
 */
import role from '@/api/role'
import permission from '@/api/permission'

export function queryByPaging(page, size, condition) {

    return role.queryByPaging(page, size, condition)
}

export function deleteById(id) {

    return role.deleteById(id)

}

export function saveOrUpdate(roleObject) {

    return role.saveOrUpdate(roleObject)
}

export function updateById(id) {

    return role.updateById(id)
}


export function exclusiveLoadPermissionsByPage(roleId, page, size) {

    return permission.exclusiveLoadPermissionsByPage(roleId, page, size)
}


export function loadRolePermissionsByPage(roleId, page, size) {

    return permission.loadRolePermissionsByPage(roleId, page, size);
}

export function assignRolePermission(roleId, permissionId) {

    return role.assignRolePermission(roleId, permissionId)
}


export function listByFuzzyMatching(roleId, page, size, key) {

    return permission.listByFuzzyMatching(roleId, page, size, key);
}

export function removeAssignRolePermission(roleId, permissionId) {

    return role.removeAssignRolePermission(roleId, permissionId);
}


export function listTree(params) {
    return role.listTree(params);
}